package design.builder;

/**
 * 指挥类-组织装者
 */
public class Director {
    private Builder builder;
    // 创建对象的时候搭载
    public Director(Builder builder) {
        this.builder = builder;
    }
    //产品构建与组装方法
    public Phone construct() {
        builder.buildPartCell();
        builder.buildPartCpu();
        builder.buildPartScreen();
        return builder.getResult();
    }
}
